package com.team407.cheyoubang;

import com.team407.cheyoubang.bean.MemberInfoBean;
import com.team407.cheyoubang.callback.NetCallBack;
import com.team407.cheyoubang.manager.RequestManager;
import com.team407.cheyoubang.parse.LoginParseData;
import com.team407.cheyoubang.parse.Result;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class MainActivity extends Activity implements NetCallBack{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		//示例
		RequestManager.newInstance().loginComm("memberNo", "password", this);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	//网络请求成功执行这里
	@Override
	public void netSuccess(String url, Result result) {
		//获取result里面的数据
		MemberInfoBean infoBean = (MemberInfoBean)result.getBean(LoginParseData.MEMBER_INFO);
	}
	//出现网络问题执行这里
	@Override
	public void netError(String url, int errorCode) {
		
	}

}
